<?php

namespace app\modules\Admin\models;

use DateTimeInterface;
use Illuminate\Database\Eloquent\Model;

class orderItemModel extends Model
{
    protected $table = 'order_item';
    protected $primaryKey = 'id';

    /**
     * @param DateTimeInterface $date
     * @return string
     */
    protected function serializeDate(DateTimeInterface $date)
    {
        return $date->format('Y-m-d H:i:s');
    }

    public function gudongfenhong()
    {
        return $this->hasMany(\gudongrewardModel::class, 'order_item_id', 'id');
    }

    public function agentreward()
    {
        return $this->hasMany(\agentrewardModel::class, 'order_item_id', 'id');
    }

    public function tuikereward()
    {
        return $this->hasMany(\tuikerewardModel::class, 'order_item_id', 'id');
    }

    public function qudaireward()
    {
        return $this->hasMany(\qudairewardModel::class, 'order_item_id', 'id');
    }
}